package com.zx.sp_mybatisplus_smbms.mapper;

import com.zx.sp_mybatisplus_smbms.pojo.SmbmsUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author lenovo
* @description 针对表【smbms_user】的数据库操作Mapper
* @createDate 2021-12-28 16:27:34
* @Entity com.zx.sp_mybatisplus_smbms.pojo.SmbmsUser
*/
public interface SmbmsUserMapper extends BaseMapper<SmbmsUser> {
    /**
     * 查询所有用户
     * @return
     */
    public List<SmbmsUser> findAllByUsers();

    /**
     * 添加用户
     * @param user
     * @return
     */
    public boolean addUsers(SmbmsUser user);

    /**
     * 修改用户
     * @param user
     * @return
     */
    public boolean updateUsers(SmbmsUser user);

    /**
     * 删除用户
     * @param uid
     * @return
     */
    public boolean delUsers(Long uid);

    /**
     * 详情
     * @param uid
     * @return
     */
    public SmbmsUser findUsersById(Long uid);

    /**
     * 登录操作
     * @param uname 用户名
     * @param pwd 密码
     * @return 返回登录对象
     */
    public SmbmsUser login(@Param("uname") String uname, @Param("pwd") String pwd);

    /**
     * 查询usercode是否存在
     * @param usercode
     * @return
     */
    public SmbmsUser findUserByCode(@Param("usercode") String usercode);

    /**
     * 条件查询user集合
     * @param username
     * @param userrole
     * @return
     */
    List<SmbmsUser> findUserListByCodeAndRole(@Param("username") String username, @Param("userrole") Long userrole);
}




